﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.CarService.Tyres;
using TianShiProject.Models.Common;
using Volo.Abp.Application.Services;

namespace TianShiProject.CarService.Tyres
{
    public class TyreService : ApplicationService
    {
        private readonly ITyreRepository _tyreRepository;
        public TyreService(ITyreRepository tyreRepository)
        {
            _tyreRepository =tyreRepository;
        }
        /// <summary>
        /// 显示轮胎使用记录
        /// </summary>
        /// <param name="cardnumber"></param>
        /// <param name="pin"></param>
        /// <param name="gui"></param>
        /// <param name="time"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<TyreDto>> GetShowTyre(string cardnumber, string pin, string gui, DateTime? time, int pageindex=1, int pagesize=3)
        {
            return await _tyreRepository.GetShowTyre(cardnumber,pin,gui, time, pageindex, pagesize);
        }
        /// <summary>
        /// 删除违章记录
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelTyre(int id)
        {
            return await _tyreRepository.DeleteDelTyre(id);
        }
        /// <summary>
        /// 批量删除事故记录
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelsTyre(string ids)
        {
            return await _tyreRepository.DeleteDelsTyre(ids);
        }
        /// <summary>
        /// 编辑修改
        /// </summary>
        /// <param name="illegalDto"></param>
        /// <returns></returns>
        public async Task<int> PutUpdateTyre(TyreDto tyreDto)
        {
            return await _tyreRepository.PutUpdateTyre(tyreDto);
        }
        /// <summary>
        /// 添加事故记录
        /// </summary>
        /// <param name="illegalDto"></param>
        /// <returns></returns>
        public async Task<int> PostAddTyre(TyreDto tyreDto)
        {
            return await _tyreRepository.PostAddTyre(tyreDto);
        }
    }
}
